/**
 * SPRINGBACK
 * A Java implementation of the Formspring API.
 * 
 * Distributed under the MIT License. See LICENSE for more information.
 */
package com.mattsfarmer.springback;

import java.util.List;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;

/**
 * This class represents a Formspring API Message. It has the 
 * capability to generate new messages and interpret incoming
 * messages by way of a special constructor.
 * @author Matt Farmer
 * @version 1.0
 */
@Root(name="response")
public class FormspringAPIResponse {
	
	///////
	// CLASS MEMBERS
	///////
	@Attribute(required=false)
	private String username;
	
	@Attribute
	private String status;					//< The response status of the message.
	
	@Element(required=false)
	private String error;
	
	@ElementList(inline=true, required=false)
	private List<FormspringItem> item;				//< The question included in this response.
	
	@ElementList(inline=true, required=false)
	private List<FormspringPerson> profile;			//< The profile included in this response.
	
	@Element(required = false)
	private int count;
	
	///////
	// CLASS METHODS
	///////

	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * @return the item
	 */
	public List<FormspringItem> getItem() {
		return item;
	}

	/**
	 * @param item the item to set
	 */
	public void setItem(List<FormspringItem> item) {
		this.item = item;
	}

	/**
	 * @return the profile
	 */
	public List<FormspringPerson> getProfile() {
		return profile;
	}

	/**
	 * @param profile the profile to set
	 */
	public void setProfile(List<FormspringPerson> profile) {
		this.profile = profile;
	}

	/**
	 * @return the count
	 */
	public int getCount() {
		return count;
	}

	/**
	 * @param count the count to set
	 */
	public void setCount(int count) {
		this.count = count;
	}

	/**
	 * @return the error
	 */
	public String getError() {
		return error;
	}

	/**
	 * @param error the error to set
	 */
	public void setError(String error) {
		this.error = error;
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}
}
